<?php

class Scrape {
/**
* Simple function to pull down XML/RSS from a url and convert it into SimpleXMLElement
*
* @param $url
* The url to get XML/RSS from
*
* @return curl response as SimpleXMLElement
*/
	public function GetRSS($url) {
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$response = curl_exec($ch);
		curl_close($ch);
		
		return preg_match("/<rss/", $response) ? new SimpleXMLElement($response) : false;
	}
}



